﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace ServiceDeskInterop
{
    [ServiceContract]
    public interface IServiceDeskService
    {
        [OperationContract]
        string Ping();
        
        [OperationContract]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(ModelFault))]
        LoginDTO Login(string loging, string password);

        
        [OperationContract]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(ModelFault))]
        IEnumerable<TaskDTO> ListTasks();
        
        [OperationContract]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(ModelFault))]
        IEnumerable<UserDTO> ListUsers();
        
        [OperationContract]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(ModelFault))]
        UserDTO AddUser(string login, string password, RoleDTO role);
        
        [OperationContract]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(ModelFault))]
        bool RemoveUser(Guid userGuid);
        
        [OperationContract]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(ModelFault))]
        void SetTaskState(Guid taskGuid, TaskStateDTO taskState);
        
        [OperationContract]
        [FaultContract(typeof(ValidationFault))]
        [FaultContract(typeof(ModelFault))]
        void Assign(Guid taskGuid, Guid userGuid);
    }
}
